<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="utf-8">
        <title>红袖阁</title>
        <meta name="keywords" content="第一卷,第二百六十六章"/>
        <meta name="description" content="择天记全文阅读之第一卷 第二百六十六章 坠入落日的倒影txt手打版更新了，本站更新最快，阅读界面清爽无弹窗。"/>
        <link href="/Novel-Website/css/bootstrap.min.css" rel="stylesheet">
        <link href="/Novel-Website/css/bootstrap-responsive.min.css" rel="stylesheet">
        <link href="/Novel-Website/css/dbcms.css" rel="stylesheet">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
    </head>
    <body>
        <header class="jumbotron subhead">

            <div class="container">
                <h1 class="text-center" id = "title">
                    <!--书名-->
                </h1>
            </div>
        </header>
        <div class="container-fluid">
            <div class="contentarea">
                <h2 class="text-center red" id="chapterName">
                    <!--目里-->
                </h2>
                <div class="content" id="content">
                    <!--内容-->
                </div>
                <div class="row-fluid bottomlink hidden-phone">
                    <div class="span3"></div>
                    <div class="span6 text-center" id="turning">
                        <!--翻页-->
                    </div>
                </div>
                <div class="bottomlink visible-phone  text-center">
                </div>
            </div>
        </div>
        <footer class="footer">
            <div class="container">
                <h6>
                    <a href="/Novel-Website/page/主页.html">
                        红袖阁小说网
                    </a>
                </h6>
            </div>
        </footer>
        <script src="/Novel-Website/js/jquery-3.3.1.js" type="text/javascript"></script>
        <script src="/Novel-Website/js/common.js" type="text/javascript"></script>
        <script type="text/javascript">
            var id = location.search;
            id = id.substring(id.indexOf("=")+1);
            window.onload = function () {
                getContent()
            };
            var url = api+"detail/getContent/"+id;
            var mark;
            var currentPage;
            function getContent() {
                $.getJSON(url,function (data) {
                    var content = data.data.chapterContent.split("　　");
                    var html = "";
                    mark = content[content.length-1].indexOf("http://www.zxcs.me/");
                    currentPage = data.data.chapterId;
                    var length =content.length;
                    var pageTurning = ' <a class="btn" href="/Novel-Website/page/内容.html?id='+(parseInt(id)-1)+'" >(←)上一章</a>\n' +
                        '               <a class="btn" href="/Novel-Website/page/目录.html?id='+data.data.bookId+'">回目录</a>\n' +
                        '               <a class="btn" href="/Novel-Website/page/内容.html?id='+(parseInt(id)+1)+'" >下一章(→)</a>';
                    if(currentPage == 1){
                        pageTurning = '               <a class="btn" href="/Novel-Website/page/目录.html?id='+data.data.bookId+'">回目录</a>\n' +
                            '               <a class="btn" href="/Novel-Website/page/内容.html?id='+(parseInt(id)+1)+'">下一章(→)</a>';
                    }
                    if(mark != -1){
                        length = length - 1;
                        pageTurning = ' <a class="btn" href="/Novel-Website/page/内容.html?id='+(parseInt(id)-1)+'">(←)上一章</a>\n' +
                            '               <a class="btn" href="/Novel-Website/page/目录.html?id='+data.data.bookId+'">回目录</a>\n' ;
                    }
                    for (var i = 1; i < length; i++) {
                        html = html+"<p>"+content[i]+"</p>";
                    }
                    $("#chapterName").html(content[0]);
                    $("#turning").html(pageTurning);
                    $("#title").html(data.data.bookName.split("（",1))
                    document.getElementById("content").innerHTML =html;
                })
            }
            $(document).keyup(function(e) {
                if (39 == e.keyCode) {
                    if (mark != -1){
                        return;
                    }
                   window.location.href = '/Novel-Website/page/内容.html?id='+(parseInt(id)+1)+'';
                }
                if(37 == e.keyCode ){
                    if (currentPage ==1){
                        return;
                    }
                    window.location.href = '/Novel-Website/page/内容.html?id='+(parseInt(id)-1)+'';
                }
            })
        </script>
    </body>
</html>